package cn.tjnext.apply.dao;

import cn.tjnext.apply.entity.AbstractEntity;
import cn.tjnext.apply.entity.PayCallBackEntity;
import cn.tjnext.apply.repositories.PayCallBackRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Component;

/**
 * Created by cp on 2017/8/14.
 */
@Component
public class PayCallBackDao extends AbstractEntityDao<PayCallBackEntity ,PayCallBackRepository> {

    @Autowired
    private PayCallBackRepository payCallBackRepository;

    @Override
    protected PayCallBackRepository getRepository() {
        return payCallBackRepository;
    }

    @Override
    public Sort getDefaultSorting() {
        return null;
    }

    @Override
    public <T extends AbstractEntity> Page<T> searchByKeyword(String keyWord, Pageable pageable) {
        return null;
    }

    public PayCallBackEntity findByOrderId(Long orderId) {
        return getRepository().findByOrderId(orderId);
    }
}
